<!DOCTYPE html>
<html lang="en">
<head>
    <{include file="public_html/header_tag.html" }>
    <link href="/static/public/layer/src/css/layui.css" rel="stylesheet">
	<script src="/static/public/layer/src/layui.js"></script>
    <style>
    	.curr i{color: #d2d2d2; background-color: #999;}
    	.layui-select-title{width: 100px;}
    </style>
</head>
<body>
<header class="brB">
	<div class="h_top">
    	<div class="hLeft"><a href="javascript:;" class="icoH icoReturn mt20"></a></div>
    	<div class="hCenter"><span class="tit c-3ac9af"><{$chapter_info.title}> (<{$chapter_action}>)</span></div>
    </div>
</header>
<div class="warp">
	<div class="pt20 fix">
        <{assign var="key" value="1"}>
        <{foreach from=$chapter_info.topic_list item=topics key=type}>
			<{foreach from=$topics item=item}>
			<{if $type == 1}>
			<div class="topic_box topic_number" key="{$key}>" topic_type="<{$type}>" <{if $item.id != $chapter_info.first_topic}>style="display: none;"<{/if}> topic_id="<{$item.id}>" id="form<{$item.id}>">
		        <div class="b-FFFFFF mt20 brT p20">
		            <div class="fs32">
		                <{$key}>、<i class="isetOdd r5 mr10 b-3ac9af">单</i><span><{$item.subject_text}></span>
		            </div>
		            <ul class="fs30 pt20 answer" topic_id="<{$item.id}>">
		                <{foreach from=$item.result item=answers key=key1}>
		                <li class="ptb10">
		                	<i class="isetEg r100 mr20"><{$letter[$key1]}></i><span answer_id="<{$answers.id}>"><{$answers.answer_text}></span>
		                </li>
		                <{/foreach}>
		            </ul>
		        </div>
		        <!--详解模式star-->
		        <div class="b-FFFFFF fix ptb30 stDetailed" style="display:none;">
		        	<div class="plr20">
		                <div class="ptb20"><span class="c-3ac9af">试题详解：</span></div>
		                <div style="color:#daac21;"><{$item.analysis}></div>
		            </div>
		        </div>
		        <div>
					<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="up_topic"><img src="/static/www/img/ico_4040_prev.png">上一题</a></div>
					<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="next_topic"><img src="/static/www/img/ico_4040_next.png">下一题</a></div>
				</div>
	        </div>
        	<!--详解模式end -->
	        <{else if $type == 2}>
	        <div class="topic_box topic_number" key="<{$key}>" topic_type="<{$type}>" <{if $item.id != $chapter_info.first_topic}>style="display: none;"<{/if}> topic_id="<{$item.id}>" id="form<{$item.id}>">
		        <div class="b-FFFFFF mt20 brT p20">
		            <div class="fs32">
		                <{$key}>、<i class="isetOdd r5 mr10 b-3ac9af">多</i><span><{$item.subject_text}></span>
		            </div>
		            <ul class="fs30 pt20 answer" topic_id="<{$item.id}>">
		            	<{foreach from=$item.result item=answers key=key1}>
		                <li class="ptb10">
		                	<i class="isetEg r100 mr20"><{$letter[$key1]}></i><span answer_id="<{$answers.id}>"><{$answers.answer_text}></span>
		                </li>
		                <{/foreach}>
		            </ul>
		        </div>
		        <!--详解模式star-->
		        <div class="b-FFFFFF fix ptb30 stDetailed" style="display:none;">
		        	<div class="plr20">
		                <div class="ptb20"><span class="c-3ac9af">试题详解：</span></div>
		                <div style="color:#daac21;"><{$item.analysis}></div>
		            </div>
		        </div>
		        <div>
					<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="up_topic"><img src="/static/www/img/ico_4040_prev.png">上一题</a></div>
					<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="next_topic"><img src="/static/www/img/ico_4040_next.png">下一题</a></div>
				</div>
	        </div>
	        <{else if $type == 3}>
	        <div class="topic_box topic_number" key="<{$key}>" topic_type="<{$type}>" <{if $item.id != $chapter_info.first_topic}>style="display: none;"<{/if}> topic_id="<{$item.id}>" id="form<{$item.id}>">
		        <div class="b-FFFFFF mt20 brT p20">
		            <div class="fs32">
		                <{$key}>、<i class="isetOdd r5 mr10 b-3ac9af">判</i><span><{$item.subject_text}></span>
		            </div>
		            <ul class="fs30 pt20 answer" topic_id="<{$item.id}>">
		                <{foreach from=$item.result item=answers key=key1}>
		                <li class="ptb10">
		                	<i class="isetEg r100 mr20"><{$letter[$key1]}></i><span answer_id="<{$answers.id}>"><{$answers.answer_text}></span>
		                </li>
		                <{/foreach}>
		            </ul>
		        </div>
		        <!--详解模式star-->
		        <div class="b-FFFFFF fix ptb30 stDetailed" style="display:none;">
		        	<div class="plr20">
		                <div class="ptb20"><span class="c-3ac9af">试题详解：</span></div>
		                <div style="color:#daac21;"><{$item.analysis}></div>
		            </div>
		        </div>
		        <div>
					<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="up_topic"><img src="/static/www/img/ico_4040_prev.png">上一题</a></div>
					<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="next_topic"><img src="/static/www/img/ico_4040_next.png">下一题</a></div>
				</div>
	        </div>
	        <{else if $type == 4}>
			<form action="/user/tiku/save_volume" key="<{$key}>" topic_type="<{$type}>" method="post" class="layui-form layui-form-pane topic_box" id="form<{$item.id}>" <{if $item.id != $chapter_info.first_topic}>style="display: none;"<{/if}> topic_id="<{$item.id}>" type="4">
				<input type="hidden" name="topic_id" value="<{$item.id}>" />
				<dl>
					<div class="fs32">
		                <{$key}>、<i class="isetOdd r5 mr10 b-3ac9af">析</i><span><{$item.subject_text}></span>
		            </div>
					<dd class="answer" style="height: auto">
						<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
							<div class="layui-tab-content">
								<{foreach from=$item.result key=k item=analys_item}>
									<div class="layui-tab-item layui-show">
										<div class="layui-form-item layui-form-text">
											<div class="layui-input-block">
												<{$k+1}>、<{$analys_item.subject_text}>
											</div>
										</div>
										
										<{if $analys_item.analys_type == 1}>
										<div class="layui-form-item tk_answer">
											<div class="layui-inline">
												<label class="layui-form-label">子题干答案</label>
												<div class="layui-input-block">
													<input type="text" name="analys[<{$analys_item.answer_list[0].aid}>][<{$analys_item.answer_list[0].id}>][answer_text]"  autocomplete="off" class="layui-input" style="width: 500px;">
												</div>
											</div>
										</div>
										<{else}>
										<{foreach from=$analys_item.answer_list key=k item=analys_result}>
										<div class="layui-form-item fl_answer">
											<div class="layui-inline">
												<label class="layui-form-label">借贷方向</label>
												<div class="layui-input-block">
													<select name="analys[<{$analys_result.aid}>][<{$analys_result.id}>][type]">
														<option value="1">借</option>
														<option value="2">贷</option>
													</select>
												</div>
											</div>
											<div class="layui-inline">
												<label class="layui-form-label">选择科目</label>
												<div class="layui-input-block">
													<input type="hidden" class="accounts" name="analys[<{$analys_result.aid}>][<{$analys_result.id}>][topic_subject_id]" >
													<input type="text" autocomplete="off" style="width:200px;" class="layui-input" readonly onclick="choice_accounts(this)">
												</div>
											</div>
											<div class="layui-inline">
												<label class="layui-form-label">答案</label>
												<div class="layui-input-block">
													<input type="text" style="width:145px;" name="analys[<{$analys_result.aid}>][<{$analys_result.id}>][answer_text]" autocomplete="off" class="layui-input">
												</div>
											</div>
										</div>
										<{/foreach}>
										<{/if}>
								    </div>
								<{/foreach}>
							</div>
						</div>
						<div class="b-FFFFFF fix ptb30 stDetailed" style="display:none;">
				        	<div class="plr20">
				                <div class="ptb20"><span class="c-3ac9af">试题详解：</span></div>
				                <div style="color:#daac21;"><{$item.analysis}></div>
				            </div>
				        </div>
				        <div>
							<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="up_topic"><img src="/static/www/img/ico_4040_prev.png">上一题</a></div>
							<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="next_topic"><img src="/static/www/img/ico_4040_next.png">下一题</a></div>
						</div>
					</dd>
				</dl>
				</form>
			<{else if $type == 7}>
			<form action="/user/tiku/save_volume" key="<{$key}>" topic_type="7" method="post" class="layui-form layui-form-pane topic_box" id="form<{$item.id}>" <{if $item.id != $chapter_info.first_topic}>style="display: none;"<{/if}> topic_id="<{$item.id}>">
				<div class="b-FFFFFF mt20 brT p20">
					<div class="fs32">
		                <{$key}>、<i class="isetOdd r5 mr10 b-3ac9af">不定向</i><span><{$item.subject_text}></span>
		            </div>

					<{foreach from=$item.result key=k item=analys_item}>
						<p style="padding-top: 10px;">
							<{$analys_item.subject_text}>
						</p>
						<ul class="fs30 pt20 answer" topic_id="<{$analys_item.id}>">
							<{foreach from=$analys_item.answer_list item=answers key=key1}>
							<li class="ptb10">
			                	<i class="isetEg r100 mr20"><{$letter[$key1]}></i><span answer_id="<{$answers.id}>"><{$answers.answer_text}></span>
			                </li>
							<{/foreach}>
						</ul>
					
					<{/foreach}>
				</div>
				<div class="topic_box" status="hasanswer">
					<div class="b-FFFFFF fix ptb30 stDetailed" style="display:none;">
			        	<div class="plr20">
			                <div class="ptb20"><span class="c-3ac9af">试题详解：</span></div>
			                <div style="color:#daac21;"><{$item.analysis}></div>
			            </div>
			        </div>
		        </div>
		        <div>
					<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="up_topic"><img src="/static/www/img/ico_4040_prev.png">上一题</a></div>
					<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="next_topic"><img src="/static/www/img/ico_4040_next.png">下一题</a></div>
				</div>
			</form>
			<{else if $type == 8 || $type == 9}>
			<div class="topic_box topic_number" key="{$key}>" topic_type="<{$type}>" <{if $item.id != $chapter_info.first_topic}>style="display: none;"<{/if}> topic_id="<{$item.id}>" id="form<{$item.id}>">
		        <div class="b-FFFFFF mt20 brT p20">
		            <div class="fs32">
		                <{$key}>、<i class="isetOdd r5 mr10 b-3ac9af"><{if $type == 8}>名词解释<{else}>简答<{/if}></i><span><{$item.subject_text}></span>
		            </div>
		            <div class="b-FFFFFF fix ptb30 ">
		            <textarea class="layui-textarea " name="subject_text"  id="editor<{$item.id}>"></textarea>
		            </div>
		        </div>
		        <div>
					<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="up_topic"><img src="/static/www/img/ico_4040_prev.png">上一题</a></div>
					<div class="line-top p-tb15" style="width: 51px;"><a href="javascript:;" class="next_topic"><img src="/static/www/img/ico_4040_next.png">下一题</a></div>
				</div>
	        </div>
	        <{/if}>
			<{$key=$key+1}>
        	<{/foreach}>
		<{/foreach}>
		
	</div>
</div>
<!--试卷报告star-->
<div class="buyShowBox" style="display:none;" id="testReport">
	<div class="buy_mask"></div>
	<!--star 选择-->
	<div class="buy_dialog b-FFFFFF">
		<div class="layout-box tac ptb20 brB">
        	<div class="box-col">答对 <span class="c-3ac9af" id="right_topic_number">0</span></div>
        	<div class="box-col">答错 <span class="c-fa3838" id="wrong_topic_number">0</span></div>
        	<div class="box-col">未答 <span class="c-999999" id="topic_number"><{$chapter_info.topic_total}></span></div>
		</div>
		<!--star支付选择-->
		<div class="paperNumber">
        	<{assign var="key" value="1"}>
			<{foreach from=$chapter_info.topic_list item=topics key=type}>
				<{foreach from=$topics item=item}>
				<!-- class="answerYes"  class="answerNo"-->
					<a class="<{if $item.has_answer == 1}>curr<{/if}> topic_id_<{$item.id}>" href="javascript:;"><{$key}></a>
				<{$key=$key+1}>
				<{/foreach}>
			<{/foreach}>
		</div>
		<!--end支付选择-->
	</div>
	<!--end 选择-->
</div>
<!--试卷报告end -->
<footer class="p_fotbtn brT">
    <div class="layout-box sysbtnfooter">
    	<a class="box-col" href="javascript:;" id="openTestReport">
        	<div class="ico syb_000"></div>
            <span>试卷报告</span>
        </a>
    	<a class="box-col" href="javascript:;">
        	<div class="ico syb_001"></div>
            <span><font id="topic_number_i">1</font>/<{$chapter_info.topic_total}></span>
        </a>
    	<a class="box-col" href="javascript:;" id="openDetailed">
        	<div class="ico syb_002"></div>
            <span>打开详解</span>
        </a>
        <input type="hidden" id="first_topic" value="form<{$chapter_info.first_topic}>" />
    </div>
</footer>
<script>
$(function(){
	$('#openDetailed').click(function(){
		$(this).addClass('curr');
		$(this).find('span').html('打开详解');
		$(".topic_box:visible").find(".stDetailed").toggle();
		// $('.stDetailed').show();
	});
	$('#openTestReport').click(function(){
		$(this).addClass('curr');
		$('#testReport').show();
	});
	$('.buy_mask').click(function(){
		$('#testReport').hide();
		$('#openTestReport').removeClass('curr');
	})

	/*$("#next_topic").click(function(){
		var _this = $(".item").find(".topic_box:visible");
		var need_show_elment = _this.next();
		if(need_show_elment.length == 1){
			_this.hide();
			need_show_elment.show();
		}
		answer_topic(_this);
	})

	$("#up_topic").click(function(){
		var _this = $(".item").find(".topic_box:visible");
		var need_show_elment = _this.prev();
		if(need_show_elment.length == 1){
			_this.hide();
			need_show_elment.show();
		}
		answer_topic(_this);
	})*/

	$(".next_topic").click(function(){
		// var _this = $(".topic_box:visible");
		var now_topic = $("#first_topic").val();
		var _this = $("#"+now_topic);
		if(_this.attr("status") == 'hasanswer' || _this.attr("topic_type") == 4 || _this.attr("topic_type") == 7 || _this.attr("topic_type") == 8 || _this.attr("topic_type") == 9){
			var need_show_elment = _this.next();
			if(need_show_elment.length == 1){
				_this.hide();
				need_show_elment.show();
				$("#first_topic").val(need_show_elment.attr("id"));
			}
			show_topic_number();
		}

		answer_topic(_this);
	})

	$(".up_topic").click(function(){
		var now_topic = $("#first_topic").val();
		var _this = $("#"+now_topic);
		// if(_this.attr("status") == 'hasanswer'){
			var need_show_elment = _this.prev();
			if(need_show_elment.length == 1){
				_this.hide();
				need_show_elment.show();
				$("#first_topic").val(need_show_elment.attr("id"));
			}
			show_topic_number();
		// }
		answer_topic(_this);
	})

	$(".answer span").click(function(){
		var topic_elem = $(this).closest(".topic_box");
		var topic_type = topic_elem.attr("topic_type");
		var curr_topic = $(this).closest("li");
		if(topic_elem.attr("status") != 'hasanswer'){
			if(curr_topic.hasClass("curr")){
				curr_topic.removeClass("curr");
			}else{
				curr_topic.addClass("curr");
				if(topic_type != 2 && topic_type != 7){
					curr_topic.siblings().removeClass("curr");
				}
			}
		}
		
		/*
		curr_topic.removeClass("accsYes accsNo");
		curr_topic.siblings().removeClass("accsYes accsNo");
		topic_elem.attr("status", "");*/
		if(topic_type != 2 && topic_type != 7){
			answer_topic($(".topic_box:visible"));
		}
	})


	function answer_topic(topic_obj){
		//做过的题目不提交
		if(topic_obj.attr("status") == 'hasanswer'){}else{
			var type = topic_obj.attr("topic_type");
			var topic_id = topic_obj.attr("topic_id");
			switch(type){
				case '1':
				case '2':
				case '3':
					var answer_id = new Array();
					var j = 0;
					$.each(topic_obj.find("li"), function(i, obj){
						if($(obj).hasClass('curr')){
							answer_id[j] = $(obj).find("span").attr('answer_id');
							j++;
						}
					})
					if(answer_id.length > 0){
						//保存答案
						$.ajax({
							type: "POST",
							url: "/my/tiku/save_topic_answer",
							dataType:"json",
							async:false,
							data:{'topic_id':topic_id, 'answer_id':answer_id},
							success: function(result){
								if(result.code == 1){
									//添加已经做过的标识
									topic_obj.attr("status", "hasanswer");
									$(".paperNumber").find(".topic_id_"+topic_id).removeClass("answerYes answerNo");
									if(result.is_right == 1){
										$("#right_topic_number").html(parseInt($("#right_topic_number").html()) + 1);
										topic_obj.addClass("right_topic_number");
										$(".paperNumber").find(".topic_id_"+topic_id).addClass("answerYes");
										// var _this = $(".topic_box:visible");
										var need_show_elment = topic_obj.next();
										if(need_show_elment.length == 1){
											topic_obj.hide();
											need_show_elment.show();
										}
										$.each(topic_obj.find("li"), function(i, obj){
											var answer_id = $(obj).find("span").attr('answer_id');
											if($.inArray(answer_id, result.right_topic) >= 0){
												$(obj).addClass("accsYes");
											}
											$(obj).removeClass("curr");
										})
									}else{
										$("#wrong_topic_number").html(parseInt($("#wrong_topic_number").html()) + 1);
										topic_obj.addClass("wrong_topic_number");
										$(".paperNumber").find(".topic_id_"+topic_id).addClass("answerNo");
										$.each(topic_obj.find("li"), function(i, obj){
											var answer_id = $(obj).find("span").attr('answer_id');
											if($.inArray(answer_id, result.right_topic) >= 0){
												$(obj).addClass("accsYes");
											}else{
												$(obj).addClass("accsNo");
											}
											$(obj).removeClass("curr");
										})
									}
									test_result();
									/*var test_end_topic_num = parseInt($("#test_end_topic_num").html())+1;
									var no_topic_total = parseInt($("#no_topic_total").html())-1;
									if(no_topic_total < 0) no_topic_total = 0;
									var topic_total = parseInt($("#topic_total").html());
									if(test_end_topic_num > topic_total) test_end_topic_num = topic_total;
									$("#test_end_topic_num").html(test_end_topic_num);
									$("#no_topic_total").html(no_topic_total);
									$("#jdt").css("width", 100 - no_topic_total / topic_total * 100 + "%");
									$("li[topic_id='"+topic_id+"']").addClass("curr");*/
								}
							}
						});
					}
				break;
				case '4':
					var answer_data = new Array();
					var j = 0;
					$.each(topic_obj.find("input"), function(i, obj){
						var name = $(obj).attr("name");
						if(typeof(name) != "undefined"){
							answer_data[name] = $(obj).val();
							j++;
						}
					})
					$.ajax({
						type: "POST",
						url: "/my/tiku/save_topic_answer",
						dataType:"json",
						async:false,
						data:$("#form"+topic_id).serializeArray(),
						contentType:'application/x-www-form-urlencoded',
						success: function(result){
							if(result.code == 1){
								//添加已经做过的标识
								topic_obj.attr("status", "hasanswer");
								/*var test_end_topic_num = parseInt($("#test_end_topic_num").html())+1;
								var no_topic_total = parseInt($("#no_topic_total").html())-1;
								if(no_topic_total < 0) no_topic_total = 0;
								var topic_total = parseInt($("#topic_total").html());
								if(test_end_topic_num > topic_total) test_end_topic_num = topic_total;
								$("#test_end_topic_num").html(test_end_topic_num);
								$("#no_topic_total").html(no_topic_total);
								$("#jdt").css("width", 100 - no_topic_total / topic_total * 100 + "%");
								$("li[topic_id='"+topic_id+"']").addClass("curr");*/

								$(".paperNumber").find(".topic_id_"+topic_id).removeClass("answerYes answerNo");
								if(result.is_right == 1){
									$("#right_topic_number").html(parseInt($("#right_topic_number").html()) + 1);
									topic_obj.addClass("right_topic_number");
									$(".paperNumber").find(".topic_id_"+topic_id).addClass("answerYes");
									// var _this = $(".topic_box:visible");
									
									$.each(topic_obj.find("li"), function(i, obj){
										var answer_id = $(obj).find("span").attr('answer_id');
										if($.inArray(answer_id, result.right_topic) >= 0){
											$(obj).addClass("accsYes");
										}
										$(obj).removeClass("curr");
									})
								}else{
									$("#wrong_topic_number").html(parseInt($("#wrong_topic_number").html()) + 1);
									topic_obj.addClass("wrong_topic_number");
									$(".paperNumber").find(".topic_id_"+topic_id).addClass("answerNo");
									$.each(topic_obj.find("li"), function(i, obj){
										var answer_id = $(obj).find("span").attr('answer_id');
										if($.inArray(answer_id, result.right_topic) >= 0){
											$(obj).addClass("accsYes");
										}else{
											$(obj).addClass("accsNo");
										}
										$(obj).removeClass("curr");
									})
								}
							}
							test_result();
						}
					});
				break;
				case '7':
					var answer_id = new Array();
					$.each(topic_obj.find("ul"), function(i, obj){
						var z_topic_id = $(obj).attr("topic_id");
						answer_id[z_topic_id] = new Array();
						var i = 0;
						$.each($(obj).find("li"), function(j, li){
							if($(li).hasClass('curr')){
								answer_id[z_topic_id][i] = $(li).find("span").attr('answer_id');
								i++;
							}
						})
					})
					if(answer_id.length > 0){
						//保存答案
						$.ajax({
							type: "POST",
							url: "/my/tiku/save_topic_answer",
							dataType:"json",
							async:false,
							data:{'topic_id':topic_id, 'bdx':answer_id},
							success: function(result){
								if(result.code == 1){
									//添加已经做过的标识
									topic_obj.attr("status", "hasanswer");
									$(".paperNumber").find(".topic_id_"+topic_id).removeClass("answerYes answerNo");
									if(result.is_right == 1){
										$("#right_topic_number").html(parseInt($("#right_topic_number").html()) + 1);
										topic_obj.addClass("right_topic_number");
										$(".paperNumber").find(".topic_id_"+topic_id).addClass("answerYes");
										// var _this = $(".topic_box:visible");

										$.each(topic_obj.find("li"), function(i, obj){
											var answer_id = $(obj).find("span").attr('answer_id');
											if($.inArray(answer_id, result.right_topic) >= 0){
												$(obj).addClass("accsYes");
											}
											$(obj).removeClass("curr");
										})

										var need_show_elment = topic_obj.next();
										if(need_show_elment.length == 1){
											topic_obj.hide();
											need_show_elment.show();
										}
										
									}else{
										$("#wrong_topic_number").html(parseInt($("#wrong_topic_number").html()) + 1);
										topic_obj.addClass("wrong_topic_number");
										$(".paperNumber").find(".topic_id_"+topic_id).addClass("answerNo");
										
										$.each(result.right_topic, function(i, obj){
											if(obj.is_right == 1){
												topic_obj.find("span[answer_id='"+obj.id+"']").parent().addClass("accsYes");
											}else{
												topic_obj.find("span[answer_id='"+obj.id+"']").parent().addClass("accsNo");
											}
										});
									}
									test_result();
								}
							}
						});
					}
				break;
				case '8':
				case '9':
					var answer_id = $("#editor"+topic_id).val();
					if(answer_id != ''){
						$.ajax({
							type: "POST",
							url: "/my/tiku/save_topic_answer",
							dataType:"json",
							async:false,
							data:{'topic_id':topic_id, 'answer_id':answer_id},
							success: function(result){
								if(result.code == 1){
									//添加已经做过的标识
									topic_obj.attr("status", "hasanswer");
									$(".paperNumber").find(".topic_id_"+topic_id).removeClass("answerYes answerNo");
									test_result();
								}
							}
						});
					}
				break;
			}
		}
		
		
		/*if($(".item").find("dl[status!='hasanswer']").length <= 0 && ! $(".center_box").hasClass("no_submit")){
			layer.confirm('题目做完了，是否交卷？', {
				title:"提示",
				icon: 1,
		  		btn: ['交卷','取消'] //按钮
			}, function(){
			  	$("#save_volume").submit();
			},function(){
				$(".center_box").addClass("no_submit");
			});
		}*/
	}
	function show_topic_number(){
		var now_topic = $("#first_topic").val();
		var _this = $("#"+now_topic);
		$("#topic_number_i").html(parseInt(_this.attr("key")))
	}
	function test_result(){
		$("#right_topic_number").html($(".right_topic_number").length);
		$("#wrong_topic_number").html($(".wrong_topic_number").length);
		$("#topic_number").html($(".topic_number").length);
	}
})
layui.use(['form', 'jquery', 'layedit', 'element'], function(){
	var layedit = layui.layedit,form = layui.form(),$ = layui.jquery, element = layui.element();
});
function choice_accounts(obj){
	$(".accounts").attr("id", "");
	$(".accounts").siblings().attr("id", "");
	$(obj).siblings(".accounts").attr("id", "hidden_id");
	$(obj).attr("id", "hidden_id_text");
	layer.open({
		type: 2,
		title: '选择科目',
		shadeClose: true,
		shade: 0.8,
		area: ['20%', '70%'],
		maxmin: true,
		content: '/tk_accounts_subject' //iframe的url
	}); 
}
</script>
</body>
</html>